
# 两数之和 哈希求解
class Solution:
    def twoSum(self, nums, target):
        dic = {}
        for i,item in enumerate(nums):
            if dic.get(target-item) != None:
                return [dic.get(target-item),i]
            else:
                dic[item]=i




if __name__ == '__main__':
    s = Solution()
    print(s.twoSum([2, 7, 11, 15], 9))

